from flask import Flask,render_template
import sqlite3

app = Flask(__name__)


@app.route('/')
def hello_world():  # put application's code here
    return render_template('index.html')

@app.route('/index')
def home():  # put application's code here
    return render_template('index.html')
@app.route('/movie')
def movie():  # put application's code here
    list = []
    conn = sqlite3.connect('movie.db')
    cur = conn.cursor()
    sql = "select * from movie"
    data = cur.execute(sql)
    for row in data:
        list.append(row)
    cur.close()
    conn.close()
    return render_template('movie.html',list=list)
@app.route('/score')
def score():  # put application's code here
    score = []
    num = []
    conn = sqlite3.connect('movie.db')
    cur = conn.cursor()
    sql = "select score,count(score) from movie group by score"
    data = cur.execute(sql)
    for row in data:
        score.append(row[0])
        num.append(row[1])
    cur.close()
    conn.close()
    return render_template('score.html', score=score, num=num)
@app.route('/team')
def team():  # put application's code here
    return render_template('team.html')
@app.route('/word')
def word():  # put application's code here
    return render_template('word.html')

@app.route('/testEcharts')
def testEcharts():  # put application's code here
    return render_template('test/testEcharts.html')


if __name__ == '__main__':
    app.run()
